import Vue from 'vue'
import Vuex from 'vuex'
import app from './modules/app'
import getters from './getters'

Vue.use(Vuex)

const store = new Vuex.Store({
  state: {
    goodsForm: {},
    mainContainerHeight: 0
  },
  mutations: {
    goodsForm: (state, data) => (state.goodsForm = data),
    SET_MAINCONTAINER_HEIGHT: (state, height) => {
      state.mainContainerHeight = height
    }
  },
  actions: {
    UpdateMainContainerHeight ({commit}, height) {
      commit('SET_MAINCONTAINER_HEIGHT', height)
    }
  },
  modules: {
    app
  },
  getters
})

export default store
